package com.yunxi.service.localService;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.yunxi.core.service.IServicePlus;
import com.yunxi.core.web.ApiResult;
import com.yunxi.model.order.*;
import com.yunxi.order.pojo.*;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 车辆订单 服务类
 * </p>
 *
 * @author chenmeng
 * @since 2019-05-07q
 */
public interface OrderVehicleService extends IServicePlus<OrderVehicle> {

     PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderForPage(OrderVehicleManagerDetailsReqVO vo, int pageIndex, int pageSize);

     PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveForPage(OrderVehicleManagerDetailsReqVO vo,int pageIndex, int pageSize);

    /**
     * 订单导出
     *
     * @param vo 查询条件
     * @return ApiResult∂
     */
    ApiResult orderExport(OrderVehicleManagerDetailsReqVO vo);

     OrderApproveDetails queryOrderApproveDetails(OrderApproveDetailsReqVO vo);

     PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveMatchCarForPage(OrderVehicleManagerDetailsReqVO vo,int pageIndex, int pageSize);

     PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckForPage(OrderVehicleManagerDetailsReqVO vo,int pageIndex, int pageSize);

     PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckForDownload(OrderVehicleManagerDetailsReqVO vo);

     PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApprovePrioritySettingForPage(OrderVehicleManagerDetailsReqVO vo,int pageIndex, int pageSize);

     PageInfo<StockResourceRespVO> queryStockResource(StockOrProductionLineResourceReqVO vo,int pageIndex, int pageSize);

     PageInfo<ProductionLineResourceRespVO> queryProductionLineResource(StockOrProductionLineResourceReqVO vo,int pageIndex, int pageSize);

     OrderVehicleDetailsRespVO queryOrderVehicleDetails(OrderVehicleDetailsReqVO vo);

     String queryStockAddrByVin(String vin);

     void bandCustomOrderNoByOrderId(OrderVehicle ov);

     PageInfo<OrderVehicleVO> relatePageList(OrderVehicleVOReq orderVehicleVOReq, Integer pageNum, Integer pageSize);

     void unBandCustomOrderNo(String orderCustomerNo,String updateBy);

    /**
     * 查询已匹配零售订单且未配车的 订货单
     * @return CustomerOrderMatchVO
     */
     List<CustomerOrderMatchVO> queryCustomerOrderMatchVO();

     /**
      * 查询未配车的订单
      * @return
      */
     List<NoMatchCarOrderForDownloadRespVO> queryNoMatchCarOrderForDownload();


    /**
     * 店端货运单确认
     * 查询功能
     * @param reqVO
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo listVehicleDeliveryInfo(OrderVehicleDeliveryReqVO reqVO, Integer pageNum, Integer pageSize);


    /**
     * 查询待入库车辆
     * @param reqVO
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo listVehicleInStock(OrderVehicleInStockReqVO reqVO, Integer pageNum, Integer pageSize);

    @Transactional
    void updateVehicleInStockStatus(OrderVehicleInStockReqVO reqVO);

    void matchVipOrder(OrderCustomerVO orderCustomerVO);

    void band(String orderCustomerNo, String orderCarId,String addr);

    void unband(String orderCarId);

    void hireInit(String vin);

    void hireCount(String vin);

    OrderVehicle queryOrderVehicleByVin(String vin);

    PageInfo<ProductionLineResourceRespVO> pageProductionLineResourceByVehicleCode(StockOrProductionLineResourceReqVO vo, int pageNum, int pageSize);

    PageInfo<StockResourceRespVO> queryStockResourceByVehicleCode(StockOrProductionLineResourceReqVO vo, int pageNum, int pageSize);

    PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckForPageVip(OrderVehicleManagerDetailsReqVO vo, int pageNum, int pageSize);

    PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckExpienceForPage(OrderVehicleManagerDetailsReqVO vo, int pageNum, int pageSize);

    ApiResult createDataForExpience(String vin);

    List<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckExpienceForDownload(OrderVehicleManagerDetailsReqVO vo);

    OrderVehicle loadByVin(String vin);

}
